{extend name="Public:base" /}
{block name="seo"}
<title>{$topicinfo['title']|clearHtml}|帖子详情页|{$Think.CONFIG.WEB_SITE_TITLE} - Powered by EasySNS!</title>


<meta name="keywords" content="{$topicinfo['gidtext']},{$Think.CONFIG.WEB_SITE_KEYWORD}">
<meta name="description" content="{$Think.CONFIG.WEB_SITE_DESCRIPTION}">
{/block}
{block name="body"}

<div class="aw-container-wrap">
    <div class="container">
        <div class="row">
            <div class="aw-content-wrap clearfix">
                <div class="col-sm-12 col-md-9 aw-main-content">
                    <!-- 话题推荐bar -->
                    <!-- 话题推荐bar -->
                    <!-- 话题bar -->
                    <div class="aw-mod aw-topic-bar" id="question_topic_editor" data-type="question"
                         data-id="{$topicinfo['id']}">


                        <div class="">
                            <a class="aw-user-name aw-user-name-o visible-xs" data-id="{$topicuserinfo['id']}"
                               href="{:es_url('user/home',array('id'=>$topicuserinfo['id']))}" rel="nofollow">
                                <img src="{$topicuserinfo.userhead|getheadurl}" alt="{$topicuserinfo['nickname']}">
                                <p>{$topicuserinfo['nickname']}</p>

                                {if condition="$topicuserinfo['rzicon'] neq 1"}
                                <i class="iconfont {$topicuserinfo['rzicon']}" {if
                                   condition="$topicuserinfo['rzuser']['type'] eq 1" }title="个人认证" [else/}title="企业认证"{/if}></i>
                                <p>{$topicuserinfo['rzuser']['statusdes']}</p>
                                {/if}
                            </a>


                        </div>

                        <div class="tag-bar clearfix">

                            {if condition="$topicinfo['gidtext']"}
                            {volist name="htlist" id="subvo"}
                            <span class="topic-tag">
				<a class="text" href="{:es_url('Topic/index',array('name'=>$subvo))}">{$subvo}</a>
				</span>
                            {/volist}
                            {/if}
                            {if condition="$topicinfo['settop'] eq 1"}<span
                                class="label label-danger es-margin-r-5">置顶</span>{/if}
                            {if condition="$topicinfo['choice'] eq 1"}<span class="label label-success">荐</span> {/if}


                        </div>
                    </div>
                    <!-- end 话题bar -->
                    <div class="aw-mod aw-question-detail aw-item">
                        <div class="mod-head">
                            <div class="biaoboxs pull-right hidden-xs">

                            </div>

                            <span class="font24">{$topicinfo['title']}</span>

                            {:hook('threadbanzhu', array('info'=>$topicinfo))}

                            {if condition="session('member_info') AND ($uid neq $topicinfo['uid'])"}

                            <div class="operate clearfix">

                                <div class="zanbox pull-right" style="margin:0px;">
                                    <a data-placement="top" data-toggle="tooltip" title="点亮帖子" class=""
                                       onclick="AWS.User.agree_topic(this, {$topicinfo.id})">
                                        <i class="iconfont icon-zan2"></i><span
                                            class="dianzan">{$topicinfo.praise}</span>
                                    </a>
                                </div>

                                {if condition="$topicinfo['hassc'] eq 1"}
                                <a href="javascript:;" onclick="AWS.User.follow($(this), 'topic', {$topicinfo['id']});"
                                   class="follow btn btn-normal btn-success pull-left active"><span>取消关注</span>
                                    <em>|</em> <b>{$topicinfo['focuscount']}</b></a>
                                {else/}
                                <a href="javascript:;" onclick="AWS.User.follow($(this), 'topic', {$topicinfo['id']});"
                                   class="follow btn btn-normal btn-success pull-left "><span>关注</span> <em>|</em> <b>{$topicinfo['focuscount']}</b></a>

                                {/if}
                            </div>
                            {/if}
                        </div>
                        <div class="mod-body">

                            <div id="content-fox" class="content markitup-box font14 line-big">
                                <style>
                                    #content-fox img {
                                        max-width: 100%;
                                    }

                                </style>
                                {$topicinfo['content']|htmlspecialchars_decode}


                                {:hook('Topicfileview', array('info'=>$topicinfo))}

                                {:hook('biaotai', array('info'=>$topicinfo))}

                            </div>

                            {if condition="$topicinfo['update_time'] gt 0"}
                            <div class="text-center" style="font-size:12px;padding:20px;color: #919191;">
                                本帖最后编辑于{$topicinfo.update_time|friendlyDate}

                            </div>
                            {/if}
                            <span class="text-color-999 pull-right" style="margin: 0 10px">
                                {if condition="$vo['content'] neq '帖子内容已被屏蔽'"}
                                    <a class="" href="javascript:tipOffsInfo({$topicuserinfo['id']},'{$topicuserinfo['nickname']}', '{$topicuserinfo.userhead|getheadurl}',{$topicinfo.id},'{$topicinfo.content}',2);">举报</a>
                                {/if}
                            </span>

                        </div>

                    </div>

                    <div class="aw-mod aw-question-comment">
                        <div class="mod-head">
                            <ul class="nav nav-tabs aw-nav-tabs active">
                                {if condition="session('member_info')"}
                                <li {if condition="$ctype eq 3" }class="active"
                                {/if}>
                                <a href="{:es_url('Topic/gview',array('id'=>$topicinfo['id'],'ctype'=>3))}">关注的人</a></li>
                                {/if}
                                <li {if condition="$ctype eq 1" }class="active"
                                    {/if}><a
                                    href="{:es_url('Topic/gview',array('id'=>$topicinfo['id'],'ctype'=>1,'asc'=>$asc))}">时间
                                {if condition="$ctype eq 1"}
                                {if condition="$asc eq 1"}<i class="iconfont icon-xia font12"></i>{else/}<i
                                        class="iconfont icon-shang font12"></i>{/if}{/if}


                            </a></li>
                                <li {if condition="$ctype eq 2" }class="active" {/if}><a href="{:es_url('Topic/gview',array('id'=>$topicinfo['id'],'ctype'=>2,'asc'=>$asc))}">票数
                                {if condition="$ctype eq 2"}
                                {if condition="$asc eq 1"}<i class="iconfont icon-xia font12"></i>{else/}<i
                                        class="iconfont icon-shang font12"></i>{/if}{/if}</a></li>


                                <h2 class="hidden-xs">{$commentlistcount} 个回复</h2>
                            </ul>

                        </div>
                        <div class="mod-body aw-feed-list">


                            {volist name="commentlist" id="vo"}
                            <div class="aw-item" id="answer_list_{$vo.id}">
                                <div class="mod-head">
                                    <a class="anchor" name="answer_{$vo.uid}"></a>
                                    <!-- 用户头像 -->

                                    <a class="aw-user-img aw-border-radius-5"
                                       data-id="{$vo['uid']}" href="{:es_url('user/home',array('id'=>$vo['uid']))}"><img
                                            src="{$vo.userhead|getheadurl}" alt="{$vo['nickname']}"></a>
                                    <!-- end 用户头像 -->
                                    <div class="title">
                                        <p>
                                            <a class="aw-user-name" data-id="{$vo['uid']}"
                                               href="{:es_url('user/home',array('id'=>$vo['uid']))}">{$vo['nickname']}</a>
                                            <span class="pull-right">
{if condition="$uid eq $vo['uid']"}
<a href="javascript:;" onclick="AWS.User.remove_ding_comment($(this).parent(), {$vo['id']});">删除</a>
{/if}

</span>
                                        </p>
                                        <p class="text-color-999 aw-agree-by">
                                            {if condition="$vo['dinguser']"}
                                            赞同来自:
                                            {volist name="vo['dinguser']" id="dingvo" key="i"}
                                            {if condition="$i eq 1"}<a data-id="{$dingvo['uid']}"
                                                                       href="{:es_url('user/home',array('id'=>$dingvo['uid']))}"
                                                                       class="aw-user-name">{$dingvo['nickname']}</a>{else/}<em>、</em><a
                                                data-id="{$dingvo['uid']}"
                                                href="{:es_url('user/home',array('id'=>$dingvo['uid']))}"
                                                class="aw-user-name">{$dingvo['nickname']}</a>{/if}


                                            {/volist}
                                            {/if}
                                        </p>
                                    </div>
                                </div>

                                <div class="mod-body clearfix">
                                    <!-- 评论内容 -->
                                    <div class="markitup-box">
                                        <style>
                                            .markitup-box img{max-width: 100%;}
                                        </style>
                                        {$vo.content|htmlspecialchars_decode|shildContent=$vo.status,0}
                                    </div>


                                    <!-- end 评论内容 -->
                                </div>
                                <div class="mod-footer">
                                    <!-- 社交操作 -->
                                    <div class="meta clearfix">
                                        <span class="text-color-999 pull-right" style="margin: 0 10px">
                                            {if condition="$vo['content'] neq '帖子内容已被屏蔽'"}
                                                <a class="" href="javascript:tipOffsInfo({$vo.uid},'{$vo['nickname']}', '{$vo.userhead|getheadurl}',{$vo.id},'{$vo.content}',0);">举报</a></span>
                                            {/if}
                                        <span class="text-color-999 pull-right">{$vo.create_time|friendlyDate}</span>
                                        <!-- 投票栏 -->
                                        <span class="operate">
								<a data-placement="bottom" data-toggle="tooltip" title="赞同回复" class="agree  disabled"
                                   onclick="AWS.User.agree_vote(this, {$vo.id},'{$userinfo['nickname']}')">
								<i class="iconfont icon-zan2"></i> 
								<b class="count">{$vo.ding}</b>
								</a>
								</span>
                                        <span class="operate">
								<a data-placement="bottom" data-toggle="tooltip" title="对回复持反对意见" class="disagree "
                                   onclick="AWS.User.disagree_vote(this, {$vo.id},'{$userinfo['nickname']}')">
								<i class="iconfont icon-zan3"></i> <b class="count">{$vo.cai}</b></a>
								</span>
                                        <!-- end 投票栏 -->
                                        <span class="operate">
										<a class="aw-add-comment " data-id="{$vo.id}" data-type="answer"
                                           data-comment-count="{$vo.subcount}" data-first-click="" href="javascript:;">
										<i class="iconfont icon-pinglun1"></i> {$vo.subcount}</a>
										</span>


                                    </div>
                                    <!-- end 社交操作 -->

                                </div>
                            </div>

                            {/volist}


                        </div>

                        <div class="mod-footer">
                            <div class="page-control">
                                {$commentlistpage}
                            </div>
                        </div>
                    </div>
                    <!-- end 问题详细模块 -->

                    <!-- 回复编辑器 -->
                    <div class="aw-mod aw-replay-box question">
                        {if condition="session('member_info')"}
                        <div class="mod-body">
                            <form id="post-thread-form" class="post-thread-form thread-form hz-unlogin-editor "
                                  method="post" post-url="#">
                                <div class="aw-mod aw-editor-box">
                                    <div class="">
                                        <div class="wmd-panel">
							            <textarea name="content" rows="10" id="post_content" class="form-control">
              </textarea>

                                            {:hook('ArticleEditor', array('name'=> 'content','number'=>10000,'value'=>
                                            '','items'=>json_encode(array('bold',
                                            'italic','underline','|','emoticons','image'))))}


                                        </div>
                                    </div>
                                    <div class="mod-body clearfix">
                                        <button id="post-thread-btn" data-url="{:es_url('Topic/commentadd')}"
                                                type="button"
                                                class="post-thread-btn btn btn-primary pull-right ajax-post">回复
                                        </button>
                                        <span class="pull-right text-color-999"
                                              id="answer_content_message">&nbsp;</span>
                                    </div>
                                </div>
                                <input type="hidden" name="pidcontent" id="pidcontent" value="0">
                                <input type="hidden" name="fid" value="{$topicinfo['id']}">
                                <input type="hidden" name="pid" value="0" id="replypid">
                            </form>
                        </div>
                        {else/}
                        <p align="center">要回复讨论请先<a href="{:es_url('user/login')}">登录</a>或<a
                                href="{:es_url('user/register')}">注册</a></p>

                        {/if}
                    </div>
                    <!-- end 回复编辑器 -->
                </div>
                <!-- 侧边栏 -->
                <div class="col-md-3 aw-side-bar hidden-xs hidden-sm">
                    <!-- 发起人 -->
                    <div class="aw-mod">
                        <div class="mod-head">
                            <h3>发帖人</h3>
                        </div>
                        <div class="mod-body">
                            <dl>
                                <dt class="pull-left aw-border-radius-5">
                                    <a href="{:es_url('user/home',array('id'=>$topicuserinfo['id']))}"><img
                                            src="{$topicuserinfo.userhead|getheadurl}"
                                            alt="{$topicuserinfo['nickname']}"></a>
                                </dt>
                                <dd class="pull-left">
                                    <a class="aw-user-name es-font14"
                                       href="{:es_url('user/home',array('id'=>$topicuserinfo['id']))}"
                                       data-id="{$topicuserinfo['id']}">{$topicuserinfo['nickname']}</a>
                                    {if condition="$topicuserinfo['rzicon'] neq 1"}
                                    <i class="iconfont {$topicuserinfo['rzicon']}" {if
                                       condition="$topicuserinfo['rzuser']['type'] eq 1" }title="个人认证" [else/}title="企业认证"{/if}></i>
                                    <p>{$topicuserinfo['rzuser']['statusdes']}</p>
                                    {else}
                                    <p class="text-color-000 es-font12">
                                        {$topicuserinfo['grades']|getusergrade=$topicuserinfo['id']}</p>
                                    <p class="text-color-000 es-font12">{$topicuserinfo.description}</p>
                                    {/if}

                                </dd>
                            </dl>

                        </div>
                    </div>
                    <!-- end 发起人 -->
                    <!-- 问题状态 -->
                    <div class="aw-mod question-status">
                        <div class="mod-head">
                            <h3>帖子状态</h3>
                        </div>
                        <div class="mod-body">
                            <ul>
                                {if condition="$uid eq $topicinfo['uid']"}
                                <li><a href="{:es_url('topic/topicedit',array('id'=>$topicinfo['id']))}"
                                       target="_blank">[编辑帖子]</a></li>
                                {/if}
                                <li>浏览: <span class="aw-text-color-blue">{$topicinfo['view']}</span></li>
                                <li>关注: <span class="aw-text-color-blue">{$topicinfo['focuscount']}</span> 人</li>

                                <li class="aw-border-radius-5" id="focus_users">
                                    {volist name="focusinfo" id="vo"}<a
                                        href="{:es_url('user/home',array('id'=>$vo['uid']))}"><img
                                        src="{$vo.userhead|getheadurl}" alt="{$vo['nickname']}" class="aw-user-name"
                                        data-id="{$vo['uid']}"></a>{/volist}
                                </li>
                            </ul>
                        </div>
                    </div>
                    <!-- end 问题状态 -->

                    <!-- 推荐内容 -->
                    <div class="aw-mod">
                        <div class="mod-head">
                            <h3>推荐内容</h3>
                        </div>
                        <div class="mod-body font-size-12">
                            <ul>
                                {volist name="znlist" id="vo"}
                                <li>
                                    <a href="{:es_url('Topic/gview',array('id'=>$vo['id']))}">{$vo['title']}</a>
                                </li>
                                {/volist}
                            </ul>
                        </div>
                    </div>
                    <!-- end 推荐内容 -->


                </div>
                <!-- end 侧边栏 -->
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
{:hook('TipoffsJavaScriptHook')}
<script>

    $(function () {

        //问题页添加评论
        AWS.Init.init_comment_box('.aw-add-comment');

        $('.reply').click(function () {

            $('#replypid').val($(this).attr('postid'));
            location.href = "#post-thread-form";

        });

        $('.post-thread-btn').click(function () {

            $.post($(this).data('url'), $('form#post-thread-form').serialize(), function (data) {

                if (data.code == 1) {

                    layer.msg(data.msg, {icon: 1, time: 1000}, function () {
                        location.reload();
                    });
                } else {

                    layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});


                }
            });
            return false;


        });


    })

</script>
{/block}